namespace win {
    export class kernel32 {
        /**获取当前目录 */
        static GetCurrentDirectory() {
            let buff = ffi.buff(PATH_CONST.MAX_PATH);
            this.kernel32.GetCurrentDirectoryA(PATH_CONST.MAX_PATH, buff);
            return ffi.string(buff);
        }
    }
    export namespace kernel32 {
        ffi.cdef(
            `
                typedef const char *LPCCH,*PCSTR,*LPCSTR;
                typedef void *HANDLE;
                typedef HANDLE HMODULE;
                int GetCurrentDirectoryA(int nBufferLength,const char* lpBuffer);
                HMODULE GetModuleHandleA(LPCSTR);
                int GetLastError();
            `
        )
        export let kernel32 = ffi.load("kernel32");
        export let GetModuleHandleA = kernel32.GetModuleHandleA as (this: void, name: string) => any;
        export let getLastError = kernel32.GetLastError as (this: void) => number;
    }

}